<script src='http://extjs.cachefly.net/ext-4.0.2a/ext-all.js'></script>
<script src='songs.json'></script>
<script>
/*
Note: This won't work x-domain, so I used apache mod-proxy a la:
    ProxyRequests Off
    <Proxy *>
    Order deny,allow
    Allow from all
    </Proxy>
    ProxyPass /lastfm http://www.last.fm/
    ProxyPassReverse /lastfm http://www.last.fm/
*/
var songn = 0;
var mp3s = [];
function getmp3(n)
{
    song = songs[n];
    try{
        var iframe = document.createElement('iframe');
        iframe.src = song.replace('www.last.fm','localhost/lastfm');
        
        iframe.onload=function(){
            try{
                mp3s.push(Ext.query('a[data-track-id]',iframe.contentDocument)[0].href);
            }catch(e){ console.log(e);
                mp3s.push('');
            }
            window.setTimeout(function(){getmp3(++songn);}, 200);
            document.body.removeChild(iframe);
        };
        document.body.appendChild(iframe);

    } catch(e){ console.log(e);
        mp3s.push('');
        window.setTimeout(function(){getmp3(++songn);}, 200);
    }
}
getmp3(songn);

</script>
<body>  
<pre>
